﻿<?xml version="1.0" encoding="utf-8" ?>

<cls:class
	name="BusLogicScsiController"
	type="http://metalx.org/Storage/Scsi/BusLogic/BusLogicScsiController"
	xmlns="http://metalx.org/Program"
	xmlns:cls="http://metalx.org/Class"
	xmlns:var="http://metalx.org/Variable"
	xmlns:clsf="http://metalx.org/i386/Functions/Class"
	xmlns:date="http://metalx.org/i386/Functions/Date"
	xmlns:time="http://metalx.org/i386/Functions/Time"
	xmlns:clk="http://metalx.org/i386/Functions/Clock"
	xmlns:obj="http://metalx.org/i386/Functions/Object"
	xmlns:sys="http://metalx.org/i386/Functions/System"
	xmlns:cat="http://metalx.org/i386/Functions/Catalog"
	xmlns:str="http://metalx.org/i386/Functions/String"
	xmlns:int="http://metalx.org/i386/Functions/Integer"
	xmlns:lst="http://metalx.org/i386/Functions/List"
	xmlns:pcif="http://metalx.org/i386/Functions/Pci"
	xmlns:hex="http://metalx.org/i386/Functions/Hexadecimal"
	xmlns:mm="http://metalx.org/i386/Functions/MemoryManager"
	xmlns:cpu="http://metalx.org/Intel/80386/Operators"
	xmlns:op="http://metalx.org/Intel/80386/Operands"
	xmlns:math="http://metalx.org/Intel/80386/Math"
	xmlns:ari="http://metalx.org/Intel/80386/Arithmetic"
	xmlns:shift="http://metalx.org/Intel/80386/Shift"
	xmlns:imm="http://metalx.org/Intel/80386/Immediate"
	xmlns:usb="http://metalx.org/Usb/Ohci/Registers"
	xmlns:pci="http://metalx.org/Pc/Pci/Ports"
	xmlns:cfg="http://metalx.org/Pc/Pci/Configuration">

	<cls:field name="Device" type="http://metalx.org/Pci/PciDevice" offset="0"/>

	<cls:method name="GetMemoryAddress" type="http://metalx.org/Hexadecimal">
		<cpu:CopyRegisterToOperand/>
		<op:DI-SIRegister/>

		<obj:GetData/>

		<cpu:CopyOperandToRegister/>
		<op:AX-SIAddress/>

		<pcif:GetBaseAddress1/>

		<cpu:AndAXWithImmediate/>
		<hex>fffffff0</hex>

		<hex:CreateObject/>

		<cpu:ReturnToNearCaller/>
	</cls:method>

	<cls:method name="GetIOAddress" type="http://metalx.org/Hexadecimal">
		<cpu:CopyRegisterToOperand/>
		<op:DI-SIRegister/>

		<obj:GetData/>

		<cpu:CopyOperandToRegister/>
		<op:AX-SIAddress/>

		<pcif:GetBaseAddress0/>

		<cpu:AndAXWithImmediate/>
		<hex>fffffffc</hex>

		<hex:CreateObject/>

		<cpu:ReturnToNearCaller/>
	</cls:method>

	<cls:method name="GetStatus" type="http://metalx.org/Hexadecimal">
		<cpu:CopyRegisterToOperand/>
		<op:DI-SIRegister/>

		<obj:GetData/>

		<cpu:CopyOperandToRegister/>
		<op:AX-SIAddress/>

		<pcif:GetBaseAddress0/>

		<cpu:AndAXWithImmediate/>
		<hex>fffffffc</hex>

		<cpu:CopyRegisterToOperand/>
		<op:AX-DXAddress/>

		<cpu:CopyImmediateToAX/>
		<int>0</int>

		<cpu:ReadFromDXPortToAL/>

		<hex:CreateObject/>

		<cpu:ReturnToNearCaller/>
	</cls:method>

	<cls:method name="GetHardDrives" type="http://metalx.org/Storage/HardDriveList">
		<sys:GetCatalog/>

		<cpu:CopyImmediateToDI/>
		<addressOf ref="className" type="Absolute32"/>

		<cat:FindType/>

		<cpu:PushSIToStack/>

		<cpu:CopyImmediateToAX/>
		<int>0</int>

		<lst:Create/>

		<cpu:CopyImmediateToAX/>
		<int>4</int>

		<cpu:PullBXFromStack/>

		<obj:Create/>

		<cpu:ReturnToNearCaller/>

		<var:string id="className">http://metalx.org/Storage/HardDriveList</var:string>
	</cls:method>

	<cls:method name="GetFloppyDrives" type="http://metalx.org/Storage/FloppyDriveList">
		<sys:GetCatalog/>

		<cpu:CopyImmediateToDI/>
		<addressOf ref="className" type="Absolute32"/>

		<cat:FindType/>

		<cpu:PushSIToStack/>

		<cpu:CopyImmediateToAX/>
		<int>0</int>

		<lst:Create/>

		<cpu:CopyImmediateToAX/>
		<int>4</int>

		<cpu:PullBXFromStack/>

		<obj:Create/>

		<cpu:ReturnToNearCaller/>

		<var:string id="className">http://metalx.org/Storage/FloppyDriveList</var:string>
	</cls:method>

	<cls:method name="GetCdDrives" type="http://metalx.org/Storage/CdDriveList">
		<sys:GetCatalog/>

		<cpu:CopyImmediateToDI/>
		<addressOf ref="className" type="Absolute32"/>

		<cat:FindType/>

		<cpu:PushSIToStack/>

		<cpu:CopyImmediateToAX/>
		<int>0</int>

		<lst:Create/>

		<cpu:CopyImmediateToAX/>
		<int>4</int>

		<cpu:PullBXFromStack/>

		<obj:Create/>

		<cpu:ReturnToNearCaller/>

		<var:string id="className">http://metalx.org/Storage/CdDriveList</var:string>
	</cls:method>

	<cls:method name="ToString" type="http://metalx.org/String">
		<cpu:CopyImmediateToDI/>
		<addressOf ref="deviceName" type="Absolute32"/>

		<str:CreateObject/>

		<cpu:ReturnToNearCaller/>

		<var:string id="deviceName">BusLogic SCSI Controller</var:string>
	</cls:method>

	<cls:method name="GetClass" type="http://metalx.org/Class">
		<cpu:CopyRegisterToOperand/>
		<op:DI-SIRegister/>

		<obj:GetType/>

		<cpu:CopyRegisterToOperand/>
		<op:SI-DIRegister/>

		<clsf:CreateObject/>

		<cpu:ReturnToNearCaller/>
	</cls:method>
</cls:class>